package com.party.core.model.system;

import com.party.core.model.BaseModel;

/**
 * 系统配置
 * Created by wei.li
 *
 * @date 2017/8/4 0004
 * @time 14:42
 */
public class SysConfig extends BaseModel{

    //名称
    private String name;

    //代码
    private String code;

    //排序
    private Integer sort;

    //类型(1.系统参数，2.开关)
    private Integer type;

    //系统值
    private String value;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        SysConfig sysConfig = (SysConfig) o;

        if (name != null ? !name.equals(sysConfig.name) : sysConfig.name != null) return false;
        if (code != null ? !code.equals(sysConfig.code) : sysConfig.code != null) return false;
        if (sort != null ? !sort.equals(sysConfig.sort) : sysConfig.sort != null) return false;
        if (type != null ? !type.equals(sysConfig.type) : sysConfig.type != null) return false;
        return value != null ? value.equals(sysConfig.value) : sysConfig.value == null;

    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (code != null ? code.hashCode() : 0);
        result = 31 * result + (sort != null ? sort.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (value != null ? value.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "SysConfig{" +
                "name='" + name + '\'' +
                ", code='" + code + '\'' +
                ", sort=" + sort +
                ", type=" + type +
                ", value='" + value + '\'' +
                '}';
    }
}
